/*
 * Created on 2004-04-26
 */
package org.opencube.data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;

/**
 * @author <a href="mailto:maciek@fingo.pl">FINGO - Maciej Mroczko</a>
 */
public class RecordSetMetaData implements Serializable
{
	private ArrayList<Column> columns = new ArrayList<Column>();

	/**
	 * @return
	 */
	public Column[] getColumns()
	{
		return this.columns == null ? null : this.columns.toArray( new Column[this.columns.size()] );
	}

	/**
	 * @param values
	 */
	public void setColumns( Column[] columns )
	{
		if( columns == null )
		{
			this.columns = null;
		}
		else
		{
			this.columns = new ArrayList<Column>();
			this.columns.addAll( Arrays.asList( columns ) );
		}
	}

	public void addColumn( Column column )
	{
		if( this.columns == null )
		{
			this.columns = new ArrayList<Column>();
		}
		this.columns.add( column );
	}
}
